package com.yex.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yex.common.utils.PageUtils;
import com.yex.dao.RedemptionLogDao;
import com.yex.entity.RedemptionLogEntity;
import com.yex.service.RedemptionLogService;
import com.yex.utils.Query;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("redemptionLogService")
public class RedemptionLogServiceImpl extends ServiceImpl<RedemptionLogDao, RedemptionLogEntity> implements RedemptionLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<RedemptionLogEntity> page = this.selectPage(
                new Query<RedemptionLogEntity>(params).getPage(),
                new EntityWrapper<RedemptionLogEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public RedemptionLogEntity selectByRedemptionId(Integer redemptionId, String time) {
        return baseMapper.selectByRedemptionId(redemptionId,time);
    }
}
